<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>iNET- Login Tiện ích văn phòng</title>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <h:outputStylesheet library="css" name="login.css"/>
        <h:outputStylesheet library="css" name="validationEngine.jquery.css"/>
        <h:outputStylesheet library="css" name="template.css"/>
        <h:outputScript library="js" name="query-1.8.2.min.js"/>
        <h:outputScript library="js" name="jquery.validationEngine-vi.js"/>
        <h:outputScript library="js" name="jquery.validationEngine.js"/>
        <script src="resources/js/jquery-1.8.2.min.js" type="text/javascript"></script>
        <script src="resources/js/jquery.validationEngine-vi.js" type="text/javascript" charset="utf-8"></script>
        <script src="resources/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
        <script>
            function hideDiv() {
                $(document).ready(function() {
                    $("div.noiteDiv").fadeTo(3000, 0, function() {
                        $("div.noiteDiv").hide();
                    });
                });
            }
        </script>
        <script>
            jQuery(document).ready(function() {
                // binds form submission and fields to the validation engine
                jQuery("#frmLogin").validationEngine();

            });
        </script>

    </h:head>
    <h:body>
        <div class="container">
            <section id="content">
                <h:form id="frmLogin">
                    <h1><h:graphicImage library="images" name="logo.png"/></h1>
                    <div id="noiteDiv" class="noiteDiv" style="color: red; margin-bottom: 10px;">
                        <h:messages id="ms" style="list-style: none"/>
                        </div>

                    <div>
                        <div id="noiteDiv" class="noiteDiv" style="color: red; margin-bottom: 10px;">
                            <h:messages style="list-style: none" for="useracc" id="erMsN" globalOnly="true" errorClass="erClass"/>
                        </div>
                        <h:inputText onblur="hideDiv()" 
                                     required="true" 
                                     requiredMessage="Tên đăng nhập không được để trống" 
                                     id="useracc" pt:placeholder="Tên đăng nhập" 
                                     value="#{userController.empLogin.acc_name}"  >
                            <f:ajax execute="@this" render="erMsN" event="blur"></f:ajax>
                        </h:inputText>                      
                    </div>


                    <div>
                        <div id="noiteDiv" class="noiteDiv" style="color: red; margin-bottom: 10px;">
                            <h:messages style="list-style: none" for="password" id="erMsP" globalOnly="true" errorClass="erClass"/>
                        </div>
                        <h:inputSecret onblur="hideDiv()" 
                                       required="true" 
                                       requiredMessage="Mật khẩu không được để trống" 
                                       pt:placeholder="Mật khẩu" 
                                       id="password" 
                                       value="#{userController.empLogin.password}" >
                        <f:ajax execute="@this" render="erMsP" event="blur"></f:ajax>
                        </h:inputSecret>
                    </div>
                    <div>
                        <h:commandButton id="btnLogin" value="Đăng nhập" action="#{userController.checkAcc()}" ></h:commandButton>
                    </div>

                </h:form>

            </section>     
        </div>
        <div class="fooder">
            <b>Thực tập viên- công ty cổ phần iNet</b> <br/>
            <b>SMS.vn - Giải pháp thanh toán và Nội dung số cho di động</b> <br/>
            <b>Địa chỉ: 247 Cầu Giấy, Q.Cầu Giấy, Tp.Hà Nội - Email: sms@inet.vn - Hotline: 0904.885.035</b>
            <br/><br/>
        </div>
    </h:body>
</html>

